/**create by yinshanpeng on 2014.5.4**/
define(["app"],function(app) {

			var deps = [ "$http", "BaseService" ];

			function userSettingResource($http, BaseService) {

				return initResource($http, BaseService.restfulUrl+ "user/");
			}
			var requestHeader = {
				"Content-Type" : "application/x-www-form-urlencoded;charset=utf-8"
			};

			function initResource($http, userUrl) {
				var url = "restful/user/getUserByUserId";
				return {
					getOrgByOrgId : function(orgId) {
						return $http.get(userUrl + "getOrgByOrgId", {
							params : {
								orgId : orgId
							}
						});
					},
					updateUser : function(userVo) {
						return $http.post(userUrl + "saveOrUpdateUser" ,angular.toJson(userVo));
					},
					updatePassword: function (userId,oldpassword,newpassword) {
		              /*  return $http.get(userUrl+"updatePassword", {
		                    params: {
		                    	userId: userId,
		                    	oldpassword:oldpassword,
		                    	newpassword:newpassword
		                    }
		                });*/
		                
		                return $http.post(userUrl+"updatePassword",{
		                	userId:userId,
		                	oldPassword:oldpassword,
		                	newpassword:newpassword
		                },{
		                    headers: requestHeader
		                });
		            }
				}
			}
			
			userSettingResource.$inject = deps;
			app.lazy.factory("UserSettingResource", userSettingResource);
		});